﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH5_2004A.Shopping.Domain
{

    [Table("tb_goods")]
    public class GoodsModel : AuditField<Guid>
    {
        public string? Name { get; set; }
        public decimal Price { get; set; } = 0;
        public int Sales { get; set; } = 0; //销量
        public bool IsUp { get; set; } = true;//默认上架
        public decimal InPrice { get; set; } = 0;
        public int Stock { get; set; } = 0; //库存
        public string? Description { get; set; } //商品详情介绍

        //sku
        //spu

    }

    [Table("tb_goodsimg")]
    public class GoodsImgModel : AuditField<Guid>
    {
        public Guid GoodsId { get; set; } //外键        
        public string ImgPath { get; set; }
    }

    /// <summary>
    /// 图片资源表
    /// </summary>
    [Table("tb_image_resource")]
    public class ImageResourceModel : AuditKey<int>
    {
        public Guid ResourceId { get; set; }
        public bool IsLocalhost { get; set; } = true; //默认为本地资源
        public string ImagePrefix { get; set; } = ""; //如果本地图片 添加的时候可以加上http://localhost:8843这样服务器地址，网络图片则不用
        public string ImagePath { get; set; }
        public string? Sort { get; set; }
    }
}
